package com.pcbly.web.job;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.Trigger;
import org.springframework.scheduling.quartz.QuartzJobBean;

public class MyQuartzJobBean extends QuartzJobBean {
	SchedulerService schedulerService;

	public void setSchedulerService(SchedulerService schedulerService) {
		this.schedulerService = schedulerService;
	}

	@Override
	protected void executeInternal(JobExecutionContext jobexecutioncontext)
			throws JobExecutionException {
		// TODO Auto-generated method stub
		Trigger trigger = jobexecutioncontext.getTrigger();
		String triggerName = trigger.getName();
		schedulerService.testMethod(triggerName);
	}

}
